# 2-1：判断变量名称是否正确
# 1.  M-32 正误：误，理由：M与数字32之间用了减号变量命名中只能出现字母，数字，下划线
# 2.  3k1 正误：误，理由：不能用数字开头
# 3.  iLength 正误：正确，理由：由字母组成但要注意字母i容易与数字1混淆
# 4.  _Width 正误：正确， 理由：遵循变量命名的规则
# 5.  else 正误：误， 理由：变量命名不能使用Python关键字，else是Python关键字


# 2-2
sName1 = "join miller"
print("1:",sName1.upper())
print("2:",sName1)
# 运行结果：1: JOIN MILLER
# 2: join miller


# 2-3
s = "\"Programming\" itself is the best way to learn programming.\n\t-Nobody."
print(s.strip())
# 运行结果："Programming" itself is the best way to learn programming.
# 	-Nobody.


# 2-4
r = int(True) + int(bool(-0.0000001)) + int(3>2)
print(r)
# 运行结果：3

# 2-5
m = "Life is short,I want to learn Python."
print(m)
# 运行结果：Life is short,I want to learn Python.

# 2-6
print("丘吉尔说：\"成功就是从失败到失败，也依然不该热情！\"")
# 运行结果：丘吉尔说："成功就是从失败到失败，也依然不该热情！"

#2-7
s = "My favorite sports are as fallows:\n\tfootball\n\ttable tennis\n\tbadminton\n\tswimming\n\trunning "
print(s)
# 运行结果：
"""
My favorite sports are as fallows:
	football
	table tennis
	badminton
	swimming
	running 
"""

# 2-8
print(s.upper())
# 运行结果：MY FAVORITE SPORTS ARE AS FALLOWS:
# 	FOOTBALL
# 	TABLE TENNIS
# 	BADMINTON
# 	SWIMMING
# 	RUNNING